home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-13 | 3.8 KB | 137 lines | [TEXT/MPS ] |
- (******************************************************************************
- *
- * Apple Macintosh Developer Technical Support
- *
- * Interfaces for the dialog utilities
- *
- * Program: Sample 3.0
- * FILE: SampleDialog - Pascal implementation
- *
- * by: Matt Deatherage
- *
- * Copyright © 1988-1993 Apple Computer, Inc.
- * All rights reserved.
- *
- *******************************************************************************
- *
- * This unit, the "SampleDialog" unit, implements the modal dialog that lets
- * you change characteristics of a given circle. The dialog includes two
- * pop-up menus, two editable text fields, eight checkboxes, three buttons
- * and one circle user item.
- *
- * Since we want Sample to run under 6.0.7 or later, we don't use the Pop-Up
- * CDEF built into the Communications Toolbox (or in System 7.0), because
- * we'd have to duplicate its functionality if it wasn't present. To this
- * end, this unit includes utility routines to draw a pop-up as a user item,
- * to Handle editable text tied to pop-ups, to turn a QuickDraw txFace byte
- * into eight checkboxes and more besides.
- *
- * It's usually better to use system functions when they're available, and
- * it would be better if this code used the pop-up CDEF if it were available,
- * since using that code automatically gets you new features as they're added
- * to the code in the system.
- *
- ******************************************************************************)
-
- UNIT SampleDialog;
-
- INTERFACE
-
- (*******************************************************************************
- * Used Units
- *******************************************************************************)
-
- USES Traps, Menus, Fonts, Packages, Resources, ToolUtils, PrintTraps, AppleTalk,
- Processes, PPCToolbox, EPPC, Notification, AppleEvents, SampleUtilities,
- TrafficLights, Features;
-
- (*******************************************************************************
- * Constants
- *******************************************************************************)
-
- CONST
-
- { Constants for the dialog templates }
-
- circleDialogID = 130;
- prefsID = 132;
-
- rSizeTooBigAlert = 131;
-
- rOnlyTenCirclesID = 4000;
- rLessThan500Please = 4001;
- rInsetTooMuch = 4002;
- rInsetMustBeChanged = 4003;
-
- { Symbolic constants for item numbers used in both dialogs }
-
- dialogTitle = 3;
-
- { Item ID numbers in the "Modify Circle" dialog }
-
- fontTitle = 4;
- fontPopUp = 5;
- sizeTitle = 6;
- sizeEditText = 7;
- sizePopUp = 8;
- styleTitle = 9;
- boldBox = 10;
- italicBox = 11;
- underlineBox = 12;
- outlineBox = 13;
- shadowBox = 14;
- condensedBox = 15;
- extendedBox = 16;
- plainBox = 17;
- textTitle = 18;
- textEditText = 19;
- colorButton = 20;
- circleUserItem = 21;
- defaultUserItem = 22;
-
- { Item ID numbers in the "Preferences" dialog }
-
- numCirclesEditText = 4;
- maxCirclesTitle = 5;
- rectSizeEditText = 6;
- rectSizeTitle = 7;
- circleInsetEditText = 8;
- circleInsetTitle = 9;
- prefsUserItem = 10;
- forNewDocsTitle = 11;
-
- { Resource IDs for the menus }
-
- mFonts = 132;
- mSize = 133;
-
- { Resource IDs for other things }
-
- rPopDownArrowID = 1000;
-
- (*******************************************************************************
- *
- * DoCircleOptions - present the "Modify Circle" dialog
- *
- * This routine takes a pointer to a circle record and presents a robust
- * dialog allowing the user to modify it. It returns TRUE if there were
- * changes to the circle.
- *
- *******************************************************************************)
-
- FUNCTION DoCircleOptions(VAR circle: CircleRec): BOOLEAN;
-
- (*******************************************************************************
- *
- * DoEditPreferences - allow the user to edit the application preferences.
- *
- *******************************************************************************)
-
- PROCEDURE DoEditPreferences;
-
- IMPLEMENTATION
-
- {$I SampleDialog.inc1.p}
-
- END. {SampleDialog unit }
-